<template>
  <view class="revert-form page--column">
    <view class="col-main f-main">
      <list-page :config="page.config">
        <template v-slot="{listData}">
          <view class="r-item" v-for="(item,index) in listData" :key="index">
            <view class="title">
              <view class="sn">订单编号：{{ item.sn }}</view>
              <view class="status">{{revertFormStatus(item.status)}}</view>
            </view>
            <view class="content" @tap="nav(`/subpackage/order/pages/revert-form/_id?id=${item.id}`)">
              <view class="c-item">
                <text>调换数量</text>
                <text>{{ item.quantity }}件</text>
              </view>
              <view class="c-item">
                <text>合格数量</text>
                <text>{{ item.qualifiedQuantity }}件</text>
              </view>
              <view class="c-item">
                <text>不合格数量</text>
                <text>{{ item.noQualifiedQuantity }}件</text>
              </view>
              <view class="c-item">
                <text>袋子费</text>
                <text>{{ item.amountPackage }}元</text>
              </view>
              <view class="c-item">
                <text>调换时间</text>
                <text>{{ item.createTime }}</text>
              </view>
            </view>
            <view class="button">
              <view class="btn" @tap="nav(`/subpackage/order/pages/revert-form/_id?id=${item.id}`)">订单详情</view>
            </view>
          </view>
        </template>
      </list-page>
    </view>
  </view>
</template>

<script>
  import listPage from '@/components/list-page';

  export default {
    components: {
      listPage
    },
    data() {
      return {
        page: {
          config: {
            entity: 'Revert',
            action: 'page',
            enablePull: true
          }
        }
      }
    }
  };
</script>

<style lang="less">
  page {
    background-color: #f7f7f7;
    overflow: hidden;

    .revert-form {
      display: flex;
      flex-direction: column;
      align-items: center;

      .f-main {
        display: flex;
        justify-content: center;
        width: 100%;
        height: 100vh;

        .r-item {
          width: 660rpx;
          padding: 20rpx;
          margin-top: 30rpx;
          background: #ffffff;
          border-radius: 20rpx;

          .title {
            display: flex;
            justify-content: space-between;
            height: 40rpx;
            margin-bottom: 70rpx;
            font-size: 32rpx;

            .sn {
              width: 500rpx;
              padding-left: 10rpx;
              font-weight: bold;
              word-break: break-all;
              border-left: 8rpx solid #d61e85;
            }

            .status {
              color: #db187c;
            }
          }

          .content {
            margin-bottom: 15rpx;
            border-bottom: 1rpx solid #f4f4f4;

            .c-item {
              display: flex;
              justify-content: space-between;
              height: 50rpx;
              margin-bottom: 35rpx;
              font-size: 30rpx;
              color: #666666;
            }
          }

          .button {
            display: flex;
            justify-content: flex-end;
            height: 55rpx;

            .btn {
              width: 160rpx;
              height: 55rpx;
              margin-left: 15rpx;
              font-size: 29rpx;
              color: #db187c;
              text-align: center;
              line-height: 55rpx;
              background: #ffffff;
              border: 1rpx solid #db187c;
              border-radius: 30rpx;
            }
          }
        }
      }
    }
  }
</style>